#ifndef PM_PANEL_TASK_H_INCLUDED
#define PM_PANEL_TASK_H_INCLUDED

#include "paneltaskgui.h"
#include "main.h"
#include "pm/task.h"

class PanelTask : public PanelTaskGui
{
	enum COLS_TODO {
		COL_TODO_NAME,
		COL_TODO_COST,
		COL_TODO_DATE
	};
	
	enum COLS_DONE {
		COL_DONE_NAME,
		COL_DONE_DATE
	};
	
public:
	PanelTask(wxWindow* parent);
	
protected:
	void ConnectPmEvents();
	void DisconnectPmEvents();

	void AddTaskTodo(const pm::Task& task);
	void SetTaskTodo(long item, const pm::Task& task);

	void AddTaskDone(const pm::Task& task);
	void SetTaskDone(long item, const pm::Task& task);
	
	void OnConnectPmEvents(wxCommandEvent& event);
	void OnProjectLoaded(wxCommandEvent& event);
	
	void OnTaskAdded(pmEvent<pm::Task>& event);
	void OnTaskUpdated(pmEvent<pm::Task>& event);
	void OnTaskRemoved(pmEvent<db::ID>& event);

	virtual void OnAddTask( wxCommandEvent& event );
	virtual void OnFinishTask( wxCommandEvent& event );
	virtual void OnWorkOnTask( wxCommandEvent& event );
	virtual void OnDelTask( wxCommandEvent& event );
	virtual void OnItemActivated( wxListEvent& event );
	virtual void OnMouseMotion( wxMouseEvent& event );
};

#endif // PM_PANEL_TASK_H_INCLUDED
